package com.example.demo.controller;

import com.example.demo.model.User;
import com.example.demo.service.LoginService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.*;

/**
 * Created by Administrator on 2018/4/1.
 */
@RestController
@RequestMapping("/user")
@Slf4j
public class TestController {

    @Autowired
    LoginService loginService;

    @PostMapping("/user/login")
    public ResponseEntity login(@RequestBody User user) {
        log.info(">>>>>> user id：{}", user.getId());
        return loginService.login(user);
    }



}
